PROJECT(replay)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

OPTION(REPLAY_USE_STBIMAGE "Use stb_image.c to load image files" ON)
OPTION(REPLAY_USE_LIBPNG "Use libpng to load png files" ON)
OPTION(REPLAY_ENABLE_UNIT_TESTS "Build the unit tests" ON)

SET(Boost_ADDITIONAL_VERSIONS "1.42.0" "1.42" "1.47" "1.47.0" "1.48" "1.48.0")

SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${replay_BINARY_DIR}/build)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${replay_BINARY_DIR}/build)

SET(Boost_USE_STATIC_LIBS OFF)

IF(WIN32)
	#FIND_PACKAGE(Boost REQUIRED)
ELSE()
	SET(Boost_USE_MULTITHREADED OFF)
    IF(REPLAY_ENABLE_UNIT_TESTS)
        FIND_PACKAGE(Boost 1.42 REQUIRED COMPONENTS unit_test_framework)
    ELSE()
        FIND_PACKAGE(Boost 1.42)
    ENDIF()
ENDIF()

LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

IF (REPLAY_USE_LIBPNG)
	FIND_PACKAGE(PNG REQUIRED)
ENDIF()

IF (REPLAY_USE_STBIMAGE)
	FIND_PATH(REPLAY_STBIMAGE_PATH stb_image.c)
ENDIF()

ADD_SUBDIRECTORY(source)

IF (REPLAY_ENABLE_UNIT_TESTS)
	ADD_SUBDIRECTORY(test)
ENDIF()
